package com.gjy.design.strategy.payment;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-06 11:09:51
 */
public class CreditCardPaymentStrategy implements PaymentStrategy {

    private String name;
    private String cardNumber;
    private String cvv;
    private String dateOfExpiry;

    public CreditCardPaymentStrategy(String name, String cardNumber, String cvv, String dateOfExpiry) {
        this.name = name;
        this.cardNumber = cardNumber;
        this.cvv = cvv;
        this.dateOfExpiry = dateOfExpiry;
    }

    @Override
    public boolean pay(double amount) {
        System.out.println(amount + " 元已通过信用卡支付。");
        System.out.println("持卡人: " + this.name);
        return true;
    }

}
